# 二开推荐阅读[如何提高项目构建效率](https://developers.weixin.qq.com/miniprogram/dev/wxcloudrun/src/scene/build/speed.html)
# 选择构建用基础镜像（选择原则：在包含所有用到的依赖前提下尽可能体积小）。如需更换，请到[dockerhub官方仓库](https://hub.docker.com/_/python?tab=tags)自行选择后替换。
# 已知alpine镜像与pytorch有兼容性问题会导致构建失败，如需使用pytorch请务必按需更换基础镜像。
FROM node:18.13-alpine3.17 as build-ui

COPY ./*.json /app/
COPY ./*.js /app/
COPY ./*.lock /app/

WORKDIR /app/

RUN npm config set registry http://mirrors.cloud.tencent.com/npm/ && \
    yarn install

COPY . /app/

RUN yarn build

# build web ui img
# docker tag [imageId] ccr.ccs.tencentyun.com/mkmk-common/a:[tag]
# 
# make image
# 更新前端资源
# docker build . -f Dockerfile  -t ccr.ccs.tencentyun.com/mkmk-common/a:mstor-web-ui
# docker push ccr.ccs.tencentyun.com/mkmk-common/a:mstor-web-ui



FROM scratch

COPY --from=build-ui /app/dist /app/dist
